home *** CD-ROM | disk | FTP | other *** search
/ C++ für Kids / C++ for kids.iso / Buch / Linien1.cpp < prev    next >
C/C++ Source or Header  |  1998-12-22  |  968b  |  26 lines

  1. //---------------------------------------------------------------------------
  2. #include <vcl\vcl.h>
  3. #pragma hdrstop
  4.  
  5. #include "Linien1.h"
  6. //---------------------------------------------------------------------------
  7. #pragma resource "*.dfm"
  8. TForm1 *Form1;
  9. //---------------------------------------------------------------------------
  10. __fastcall TForm1::TForm1(TComponent* Owner)
  11.     : TForm(Owner)
  12. {
  13. }
  14. //---------------------------------------------------------------------------
  15. void __fastcall TForm1::Button1Click(TObject *Sender)
  16. {
  17.   // Rechteck und Ellipse
  18.   Canvas->Rectangle (10, 10, ClientWidth-10, ClientHeight-10);
  19.   Canvas->Ellipse (20, 20, ClientWidth-20, ClientHeight-20);
  20.   // Kreuz
  21.   Canvas->MoveTo (0, ClientHeight/2);
  22.   Canvas->LineTo (ClientWidth, ClientHeight/2);
  23.   Canvas->MoveTo (ClientWidth/2, 0);
  24.   Canvas->LineTo (ClientWidth/2, ClientHeight);
  25. }
  26. //---------------------------------------------------------------------------